/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.insta.bankSystem;

/**
 *
 * @author Sebastien
 */
public abstract class AccountBase
{
    // Titulaire du compte
    private Customer _customer;
    
    // Solder actuel du compte. 
    private double _balance;        
    
    
    public AccountBase(Customer customer, double initialDeposit)
    {
        _customer = customer;
        
        // On passe par notre méthode de dépôt, qui se charge 
        // d'effectuer les tests sur le montant.
        Deposit(initialDeposit);
    }
    
    /**
     * Deposits the specified amount of money on the account.
     * @param amount the amount to be added to the account
     */
    public void Deposit(double amount)
    {
        if(amount > 0)
        {
            _balance += amount;
        }
    }
    
    public void run(StrategyBase strategy)
    {
        strategy.run(this);
    }
    

    /**
     * Withdraws the specified amount of money on the account.
     * @param amount the amount to be added to the account
     */

    public void Withdraw(double amount)
    {
        if(amount > 0)
        {
            _balance -= amount;
        }
    }    
    
    /**
     * getMonthlyFees();
     * @return the monthly fees withdrawn each month 
     * from the account
     */
    public abstract double getMonthlyFees();
    
    
    
    
    
    
    
    /**
     * Returns the Customer that owns the Account
     * @return the Customer that owns the Account
     */
    public Customer getCustomer()
    {
        return _customer;
    }
    
    /**
     * Returns the actual account's balance
     * @return the actual account's balance
     */
    public double getBalance()
    {
        return _balance;
    }
            
    
    
}
